<div class="modal modal-add fade" role="dialog" aria-hidden="true" style="overflow-y: auto;">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title">添加{{name}} <span class="entity-name text-danger"></span></h4>
            </div>
            <form role="form">
                {{#if hiddens}}
                    {{#each hiddens}}
                        <input type="hidden" name="{{name}}" value="{{value}}">
                    {{/each}}
                {{/if}}
                <div class="modal-body">
                    <div class="row">
                        {{#each fields}}
                            <div class="col-md-{{or ../columns 12}}">
                                <div class="form-group">
                                    <label>{{{label}}}</label>
                                    {{#if_eq type 'text'}}
                                        <input name="{{@key}}" type="{{type}}" class="form-control {{classes}}"
                                               value="{{defaultValue}}"
                                               placeholder="请输入{{label}} ..."/>
                                    {{/if_eq}}
                                    {{#if_eq type 'password'}}
                                        <input name="{{@key}}" type="{{type}}" class="form-control {{classes}}"
                                               value="{{defaultValue}}"
                                               placeholder="请输入{{label}} ..."/>
                                    {{/if_eq}}
                                    {{#if_eq type 'file'}}
                                        <input name="{{@key}}" type="{{type}}" class="form-control {{classes}}"
                                               value="{{defaultValue}}"
                                               placeholder="请输入{{label}} ..."/>
                                    {{/if_eq}}
                                    {{#if_eq type 'select'}}
                                        <select name="{{@key}}" class="form-control {{classes}}"
                                                value="{{defaultValue}}">
                                            {{#each options}}
                                                <option value="{{value}}">{{text}}</option>
                                            {{/each}}
                                        </select>
                                    {{/if_eq}}
                                    {{#if_eq type 'textarea'}}
                                        <textarea name="{{@key}}" class="form-control {{classes}}"
                                                  value="{{defaultValue}}"
                                                  placeholder="请输入{{label}} ..."></textarea>
                                    {{/if_eq}}
                                </div>
                            </div>
                        {{/each}}
                    </div>
                    <div class="row extend-fields"
                         style="display: none; border-top: 1px solid #e5e5e5; padding-top: 15px;"></div>
                </div>

                <div class="modal-footer">
                    <button type="button" class="btn btn-default pull-left" data-dismiss="modal">取消</button>
                    <button type="submit" class="btn btn-primary">保存</button>
                </div>
            </form>
        </div>
    </div>
</div>